import urllib.request as ur
import chardet as c

def cheak(url):
    response = ur.urlopen(url).read()
    coding = c.detect(response)['encoding']
    print("该网页使用的编码为： %s " % coding)


url = input("请输入网页url:")
cheak(url)
